package com.epam.avtobaza.modules;

public class Man { // contains information about human
	private int id;
	private String firstName;
	private String secondName;
	private String middleName;

	protected Man(int id, String secondName, String firstName) {
		this.id = id;
		this.firstName = firstName;
		this.secondName = secondName;
	}

	protected Man(int id, String secondName, String firstName, String middleName) {
		this.id = id;
		this.firstName = firstName;
		this.secondName = secondName;
		this.middleName = middleName;
	}

	public int getId() {
		return id;
	}

	// TODO Write exception when middleName=null
	public String getName() {
		if(this.middleName == null){
			return secondName + " " + firstName.charAt(0)+".";
		}
		return secondName + " " + firstName.charAt(0) + ". "
				+ middleName.charAt(0) + ".";
	}

	public String getFullName() {
		return secondName + " " + firstName + " " + middleName;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getSecondName() {
		return secondName;
	}

	public String getMidleName() {
		return middleName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setSecondName(String secondName) {
		this.secondName = secondName;
	}

	public void setMidleName(String midleName) {
		this.middleName = midleName;
	}

}
